﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL.Validation
{
    public class ValidationResult
    {
        public List<string> Message { get; set; }

        public bool Valid
        { 
            get { return !Message.Any(); } 
        }

        public ValidationResult()
        {
            Message = new List<string>();
        }

        public override string ToString()
        {
            var sb = new StringBuilder();
            Message.ForEach(m => sb.AppendLine(m));
            return sb.ToString();
        }

        public string ToErrorString()
        {
            var sb = new StringBuilder();
            Message.ForEach(m => sb.Append(m + " - "));
            return sb.ToString();
        }
    }
}
